﻿<!DOCTYPE html>

<html>
  <head> 
	<?php include 'functions.php'; 
		inclHeader();
		deleteFromCart();	
	?>
	<link rel = "stylesheet"  type = "text/css" href = "CSS.css" />
	<meta charset = "utf-8">
  	<title> Podutik Records </title>
  	<style type="text/css"></style>
	<script src="jquery.js"></script>
	<script src="myQuery.js"></script>
  </head>
  <body>
	<div id="page-container" >
		<div id="main-nav">	
			<div class="block" id="bl1" style="background-color: #EEEEEE;">
				
			</div>	
			<div class = "login">
				<strong><a href="vsaNarocila.php" id="narocila">View Orders</a></strong>
			</div>
		</div>
			
		<div id="header">		
			<a href="./index.php"><img id="logo1" src="podutikrecords1.jpg" 
			width="236" height="36" alt="Enlighten Designs" /></a>	
		</div>
			<?php
				if (isset($_SESSION['cart'])){
					if (count($_SESSION['cart']) > 0){
			?>
			<h6 id="kosarica">Cart</h6>
			<div id="content" style="margin-left: 150px;">				
				<table id="kos-tab">   					
					<thead>
						<tr> <!-- <tr> inserts a table row -->
						   <th style="width: 35px;"></th>
						   <th class="thclass" style="width: 515px;"><label id="itm">Item</label></th>
						   <th class="thclass" style="width: 55px;"><label id="prc">Price</label></th>
						</tr>
					</thead>						
						<tbody>
						
						<?php
							$totalPrice = displayCart();					
						?>
					</tbody>
				</table>
				<div class="checkout">
                                    <h1><label id="sub">Subtotal: </label></h1> <h2><?php echo "$", round($totalPrice, 2);?></h2>
                                    <br/>
                                    <h1><label id="shp">Shipping: </label></h1> <h2><?php echo "$", round($totalPrice/10+1.99, 2);?></h2>
                                    <br/>
                                    <hr/>
                                    <h1><label id="tot">Total: </label></h1> <h2><?php echo "$", round($totalPrice/10+1.99 + $totalPrice, 2);?></h2>
				</div>
                            <form method="post" action="narocila.php?call=order">
                                <input type="number" name="potrdiKosarico" style="visibility: hidden;" value="1"/>
                                <input type="image" src="checkout2.jpg" class="checkoutpic" id="checkout" alt="buy it"  /></a>
                            </form>
                                
			</div>
			<?php
					}else{
						echo "<h6 id=\"kosaricaNothing\">Nothing in cart</h6>";
						echo "<div id=\"content\" style=\"margin-left: 150px; margin-bottom: 200px;\"></div>";
					}
				}else{
					echo "<h6 id=\"kosaricaNothing\">Nothing in cart</h6>";
					echo "<div id=\"content\" style=\"margin-left: 150px; margin-bottom: 200px;\"></div>";
				}
			?>			
				<?php
                    footer();
                ?>
		</div>
  </body>
</html>